from django.urls import path, re_path
from . import views

urlpatterns = [
    path('news/<int:nid>/', views.news),
    path('news02/<str:name>/', views.news02),
    path('news03/<slug:parameter>/', views.news03),
    path('article/', views.article),

    # 正则表达式路由
    re_path(r'users/(\w+-\d+)/', views.users),

    # 指定参数名称的正则表达式
    re_path(r'users/(?P<xid>\w+-\d+)/(?P<yid>\d+)/', views.users02),
]